New Xenbus driver structure, bringing an explicit state machine to the table.
This will make the drivers more robust to failure of the other end, and makes
current driver state more visible. It also allows us to bring very similar
pieces of code from the drivers together into the xenbus driver. This should
be the start of a fix to the problem with block and net device hotplugging,
because the code was previously confused about the difference between the
connection state of the kernel device layer, and the state of the xenbus
communication. This confusion is addressed here.
Much of this work is influenced by Rusty Russell's skeleton driver, recently
posted to xen-devel, as that piece made suggestions as to structure and
arrangement that have been taken on board, albeit pushed down into the xenbus
layer.
A new file xenbus_client.c has been added. This file implements the interface
between the xenbus layer and the layer specific to the driver. Access to
lower layers is still allowed for those who do not need all the facilities of
the new driver.
xenbus_dev_error has moved from xenbus_xs.c into xenbus_client.c, and
xenbus_dev_ok has been removed, in favour of xenbus_switch_state.
DevController.py now closes down a device by writing a change to the Closing
state on the backend, to allow the frontend time to close down properly. Its
also writes the frontend and backend details within the same transaction.
The timeout on the hotplug scripts has been cranked down from 2 minutes to 5
seconds.
The diagnose script has been updated to parse the new states.
The blktab and tpm drivers have yet to be ported to this structure.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
13 files changed: